import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 苏李涛
 * Date: 2024-05-07
 * Time: 23:58
 */
public class Main {
    public static void main(String[] args) {
        int[][] array = new int[][]{{1,2,3},{4,5,6}};
        int[][] array1 = {{1,2,3},{4,5,6}};
        int[][] array2 = new int[3][3];
        System.out.println(Arrays.toString(array1[0]));
        System.out.println(Arrays.toString(array1[1]));

        /*for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 3; j++) {
                System.out.print(array[i][j] + " ");
            }
        }*/

        System.out.println();
            //二维数组就是一个特殊的一维数组
        /*for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j] + " ");
            }
        }*/

        System.out.println("--------");

        /**
         *
         *foreach循环 “；” 左右两边-》（遍历数组的每一个元素(包括数组的数据类型)） ；（遍历的这个数组）
         * 
         */
        for (int[] tmpArray :array) {
            for (int x :tmpArray) {
                System.out.print(x + " ");
            }
        }


        System.out.println();
        System.out.println("----------");

        /*String ret = Arrays.deepToString(array);
        System.out.println(ret);*/


        System.out.println("-----------");
        int[][] array3 = new int[3][];
    }
}
